import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { LayoutComponent } from './base/layout/layout.component';
import { DashboardComponent } from './base/dashboard/dashboard.component';
import { LoginComponent } from './base/login/login.component';

import { AuthGuard } from '../core/services';


const routes: Routes = [
  {
    path: '',
    component: LayoutComponent,
    canActivate: [AuthGuard],
    canActivateChild: [],
    children: [
      { path: '', redirectTo: 'dashboard', pathMatch: 'full' },
      { path: 'dashboard', component: DashboardComponent},
      {
        path: 'payment', loadChildren: './payment/payment.module#PaymentModule',
      },
      // { path: 'style', loadChildren: './style/style.module#StyleModule' },
    ],
  }, {
    path: 'login',
    component: LoginComponent,
    canActivate: []
  }
];

@NgModule({
  imports: [
    RouterModule.forRoot(routes),
  ],
  exports: [RouterModule]
})
export class AppRoutingModule { }
